﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing {
    import org.aswing.geom.*;
    import flash.text.*;

    public class ASFont {

        private var name:String;
        private var size:uint;
        private var bold:Boolean;
        private var italic:Boolean;
        private var underline:Boolean;
        private var textFormat:TextFormat;
        private var advancedProperties:ASFontAdvProperties;

        public function ASFont(_arg1:String="Tahoma", _arg2:Number=11, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=false, _arg6=null){
            this.name = _arg1;
            this.size = _arg2;
            this.bold = _arg3;
            this.italic = _arg4;
            this.underline = _arg5;
            if ((_arg6 is ASFontAdvProperties)){
                this.advancedProperties = (_arg6 as ASFontAdvProperties);
            } else {
                this.advancedProperties = new ASFontAdvProperties((_arg6 == true));
            };
            this.textFormat = this.getTextFormat();
        }
        public function getName():String{
            return (this.name);
        }
        public function changeName(_arg1:String):ASFont{
            return (new ASFont(_arg1, this.size, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function getSize():uint{
            return (this.size);
        }
        public function changeSize(_arg1:int):ASFont{
            return (new ASFont(this.name, _arg1, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function isBold():Boolean{
            return (this.bold);
        }
        public function changeBold(_arg1:Boolean):ASFont{
            return (new ASFont(this.name, this.size, _arg1, this.italic, this.underline, this.advancedProperties));
        }
        public function isItalic():Boolean{
            return (this.italic);
        }
        public function changeItalic(_arg1:Boolean):ASFont{
            return (new ASFont(this.name, this.size, this.bold, _arg1, this.underline, this.advancedProperties));
        }
        public function isUnderline():Boolean{
            return (this.underline);
        }
        public function changeUnderline(_arg1:Boolean):ASFont{
            return (new ASFont(this.name, this.size, this.bold, this.italic, _arg1, this.advancedProperties));
        }
        public function isEmbedFonts():Boolean{
            return (this.advancedProperties.isEmbedFonts());
        }
        public function getAdvancedProperties():ASFontAdvProperties{
            return (this.advancedProperties);
        }
        public function apply(_arg1:TextField, _arg2:int=-1, _arg3:int=-1):void{
            this.advancedProperties.apply(_arg1);
            _arg1.setTextFormat(this.textFormat, _arg2, _arg3);
            _arg1.defaultTextFormat = this.textFormat;
        }
        public function getTextFormat():TextFormat{
            return (new TextFormat(this.name, this.size, null, this.bold, this.italic, this.underline, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0));
        }
        public function computeTextSize(_arg1:String, _arg2:Boolean=true):IntDimension{
            return (AsWingUtils.computeStringSizeWithFont(this, _arg1, _arg2));
        }
        public function clone():ASFont{
            return (new ASFont(this.name, this.size, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function toString():String{
            return (((((((((((((("ASFont[" + "name : ") + this.name) + ", size : ") + this.size) + ", bold : ") + this.bold) + ", italic : ") + this.italic) + ", underline : ") + this.underline) + ", advanced : ") + this.advancedProperties) + "]"));
        }

    }
}//package org.aswing 
